{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React, { useRef } from 'react';\nimport classNames from 'classnames';\nimport MemoChildren from './MemoChildren';\nvar sentinelStyle = {\n  width: 0,\n  height: 0,\n  overflow: 'hidden',\n  outline: 'none'\n};\nvar Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n    className = props.className,\n    style = props.style,\n    title = props.title,\n    ariaId = props.ariaId,\n    footer = props.footer,\n    closable = props.closable,\n    closeIcon = props.closeIcon,\n    onClose = props.onClose,\n    children = props.children,\n    bodyStyle = props.bodyStyle,\n    bodyProps = props.bodyProps,\n    modalRender = props.modalRender,\n    onMouseDown = props.onMouseDown,\n    onMouseUp = props.onMouseUp,\n    holderRef = props.holderRef,\n    visible = props.visible,\n    forceRender = props.forceRender,\n    width = props.width,\n    height = props.height;\n  // ================================= Refs =================================\n  var sentinelStartRef = useRef();\n  var sentinelEndRef = useRef();\n  React.useImperativeHandle(ref, function () {\n    return {\n      focus: function focus() {\n        var _sentinelStartRef$cur;\n        (_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 ? void 0 : _sentinelStartRef$cur.focus();\n      },\n      changeActive: function changeActive(next) {\n        var _document = document,\n          activeElement = _document.activeElement;\n        if (next && activeElement === sentinelEndRef.current) {\n          sentinelStartRef.current.focus();\n        } else if (!next && activeElement === sentinelStartRef.current) {\n          sentinelEndRef.current.focus();\n        }\n      }\n    };\n  });\n  // ================================ Style =================================\n  var contentStyle = {};\n  if (width !== undefined) {\n    contentStyle.width = width;\n  }\n  if (height !== undefined) {\n    contentStyle.height = height;\n  }\n  // ================================ Render ================================\n  var footerNode;\n  if (footer) {\n    footerNode = /*#__PURE__*/React.createElement(\"div\", {\n      className: \"\".concat(prefixCls, \"-footer\")\n    }, footer);\n  }\n  var headerNode;\n  if (title) {\n    headerNode = /*#__PURE__*/React.createElement(\"div\", {\n      className: \"\".concat(prefixCls, \"-header\")\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      className: \"\".concat(prefixCls, \"-title\"),\n      id: ariaId\n    }, title));\n  }\n  var closer;\n  if (closable) {\n    closer = /*#__PURE__*/React.createElement(\"button\", {\n      type: \"button\",\n      onClick: onClose,\n      \"aria-label\": \"Close\",\n      className: \"\".concat(prefixCls, \"-close\")\n    }, closeIcon || /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-close-x\")\n    }));\n  }\n  var content = /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(prefixCls, \"-content\")\n  }, closer, headerNode, /*#__PURE__*/React.createElement(\"div\", _extends({\n    className: \"\".concat(prefixCls, \"-body\"),\n    style: bodyStyle\n  }, bodyProps), children), footerNode);\n  return /*#__PURE__*/React.createElement(\"div\", {\n    key: \"dialog-element\",\n    role: \"dialog\",\n    \"aria-labelledby\": title ? ariaId : null,\n    \"aria-modal\": \"true\",\n    ref: holderRef,\n    style: _objectSpread(_objectSpread({}, style), contentStyle),\n    className: classNames(prefixCls, className),\n    onMouseDown: onMouseDown,\n    onMouseUp: onMouseUp\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    tabIndex: 0,\n    ref: sentinelStartRef,\n    style: sentinelStyle,\n    \"aria-hidden\": \"true\"\n  }), /*#__PURE__*/React.createElement(MemoChildren, {\n    shouldUpdate: visible || forceRender\n  }, modalRender ? modalRender(content) : content), /*#__PURE__*/React.createElement(\"div\", {\n    tabIndex: 0,\n    ref: sentinelEndRef,\n    style: sentinelStyle,\n    \"aria-hidden\": \"true\"\n  }));\n});\nif (process.env.NODE_ENV !== 'production') {\n  Panel.displayName = 'Panel';\n}\nexport default Panel;","map":{"version":3,"names":["_objectSpread","_extends","React","useRef","classNames","MemoChildren","sentinelStyle","width","height","overflow","outline","Panel","forwardRef","props","ref","prefixCls","className","style","title","ariaId","footer","closable","closeIcon","onClose","children","bodyStyle","bodyProps","modalRender","onMouseDown","onMouseUp","holderRef","visible","forceRender","sentinelStartRef","sentinelEndRef","useImperativeHandle","focus","_sentinelStartRef$cur","current","changeActive","next","_document","document","activeElement","contentStyle","undefined","footerNode","createElement","concat","headerNode","id","closer","type","onClick","content","key","role","tabIndex","shouldUpdate","process","env","NODE_ENV","displayName"],"sources":["/data/messenger.client/node_modules/rc-dialog/es/Dialog/Content/Panel.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React, { useRef } from 'react';\nimport classNames from 'classnames';\nimport MemoChildren from './MemoChildren';\nvar sentinelStyle = {\n  width: 0,\n  height: 0,\n  overflow: 'hidden',\n  outline: 'none'\n};\nvar Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n    className = props.className,\n    style = props.style,\n    title = props.title,\n    ariaId = props.ariaId,\n    footer = props.footer,\n    closable = props.closable,\n    closeIcon = props.closeIcon,\n    onClose = props.onClose,\n    children = props.children,\n    bodyStyle = props.bodyStyle,\n    bodyProps = props.bodyProps,\n    modalRender = props.modalRender,\n    onMouseDown = props.onMouseDown,\n    onMouseUp = props.onMouseUp,\n    holderRef = props.holderRef,\n    visible = props.visible,\n    forceRender = props.forceRender,\n    width = props.width,\n    height = props.height;\n  // ================================= Refs =================================\n  var sentinelStartRef = useRef();\n  var sentinelEndRef = useRef();\n  React.useImperativeHandle(ref, function () {\n    return {\n      focus: function focus() {\n        var _sentinelStartRef$cur;\n        (_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 ? void 0 : _sentinelStartRef$cur.focus();\n      },\n      changeActive: function changeActive(next) {\n        var _document = document,\n          activeElement = _document.activeElement;\n        if (next && activeElement === sentinelEndRef.current) {\n          sentinelStartRef.current.focus();\n        } else if (!next && activeElement === sentinelStartRef.current) {\n          sentinelEndRef.current.focus();\n        }\n      }\n    };\n  });\n  // ================================ Style =================================\n  var contentStyle = {};\n  if (width !== undefined) {\n    contentStyle.width = width;\n  }\n  if (height !== undefined) {\n    contentStyle.height = height;\n  }\n  // ================================ Render ================================\n  var footerNode;\n  if (footer) {\n    footerNode = /*#__PURE__*/React.createElement(\"div\", {\n      className: \"\".concat(prefixCls, \"-footer\")\n    }, footer);\n  }\n  var headerNode;\n  if (title) {\n    headerNode = /*#__PURE__*/React.createElement(\"div\", {\n      className: \"\".concat(prefixCls, \"-header\")\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      className: \"\".concat(prefixCls, \"-title\"),\n      id: ariaId\n    }, title));\n  }\n  var closer;\n  if (closable) {\n    closer = /*#__PURE__*/React.createElement(\"button\", {\n      type: \"button\",\n      onClick: onClose,\n      \"aria-label\": \"Close\",\n      className: \"\".concat(prefixCls, \"-close\")\n    }, closeIcon || /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-close-x\")\n    }));\n  }\n  var content = /*#__PURE__*/React.createElement(\"div\", {\n    className: \"\".concat(prefixCls, \"-content\")\n  }, closer, headerNode, /*#__PURE__*/React.createElement(\"div\", _extends({\n    className: \"\".concat(prefixCls, \"-body\"),\n    style: bodyStyle\n  }, bodyProps), children), footerNode);\n  return /*#__PURE__*/React.createElement(\"div\", {\n    key: \"dialog-element\",\n    role: \"dialog\",\n    \"aria-labelledby\": title ? ariaId : null,\n    \"aria-modal\": \"true\",\n    ref: holderRef,\n    style: _objectSpread(_objectSpread({}, style), contentStyle),\n    className: classNames(prefixCls, className),\n    onMouseDown: onMouseDown,\n    onMouseUp: onMouseUp\n  }, /*#__PURE__*/React.createElement(\"div\", {\n    tabIndex: 0,\n    ref: sentinelStartRef,\n    style: sentinelStyle,\n    \"aria-hidden\": \"true\"\n  }), /*#__PURE__*/React.createElement(MemoChildren, {\n    shouldUpdate: visible || forceRender\n  }, modalRender ? modalRender(content) : content), /*#__PURE__*/React.createElement(\"div\", {\n    tabIndex: 0,\n    ref: sentinelEndRef,\n    style: sentinelStyle,\n    \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